      SUBROUTINE QUIKVIS2(IERR,IEND)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C THIS ROUTINE IS PART OF THE QUIKVIS PROGRAM.  IT IS THE DRIVER FOR
C LOWER LEVEL ROUTINES THAT PROMPT THE USER FOR PROGRAM CONTROLS.
C
C VARIABLE DIM TYPE I/O DESCRIPTION
C -------- --- ---- --- -----------
C
C IERR      1   I*4  O  ERROR RETURN FLAG
C                       =0, NO ERRORS.
C                       = OTHERWISE, ERROR PRESENT.
C
C IEND      1   I*4  O  END-FILE FLAG
C                       =0, NO END-FILE ENCOUNTERED DURING USER INPUT.
C                       =1, END-FILE ENCOUNTERED.
C
C***********************************************************************
C
C BY C PETRUZZO/GFSC/742.   2/86.
C       MODIFIED....
C
C***********************************************************************
C
      INCLUDE 'QUIKVIS.INC'
C
      LOGICAL FIRSTCALL/.TRUE./
C
      IERR = 0
      IEND = 0
C
C
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
C
C
C USER TELLS PGM WHETHER THIS IS AN INTERACTIVE RUN. PGM RESPONSE TO
C ERRORS IS DETERMINED BY THIS FLAG.
C
      IF(FIRSTCALL) THEN
        CALL QUIKVIS2A(IERR,IEND)
        CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
        IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
        END IF
C
C
C USER SETS TIME INTERVAL.
C
      CALL QUIKVIS2B(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
C USER SETS ORBIT ALTITUDE
C
      CALL QUIKVIS2C(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
C USER SETS ORBIT INCLINATION
C
      CALL QUIKVIS2D(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
C USER SETS NODE RANGE BY SPECIFYING IT DIRECTLY OR BY SPECIFYING
C RANGE OF MEAN SOLAR TIME.
C
      CALL QUIKVIS2E(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
C USER SETS OUTPUT OPTIONS.
C
      CALL QUIKVIS2F(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
C USER SETS MISC PARAMETERS
C
      CALL QUIKVIS2G(IERR,IEND)
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      IF(IERR.NE.0 .OR. IEND.NE.0) GO TO 9999
C
C
 9999 CONTINUE
C
C WRAP UP. STORE DATA IN QUIKVIS999 ARRAYS FOR RETRIEVAL ELSEWHERE.
C
      FIRSTCALL = .FALSE.
      CALL QUIKVIS999(1,R8DATA,I4DATA,L4DATA)
C
      RETURN
      END
